package org.huel.backend.domain.dto;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;


@Setter
@Getter
public class AttendanceSearchDTO {
    // Getter和Setter方法
    private String classId;
    private String studentName;
    private String courseName;
    private String studentId;
    private Integer isAbsent; // 0-出勤, 1-缺勤, null-全部
    private String startDate;
    private String endDate;
    private Integer page = 1;
    private Integer pageSize = 20;
    private String sortBy = "timestamp";
    private String sortOrder = "desc";

    // 构造函数
    public AttendanceSearchDTO() {}

    public Integer getOffset() {
        return (page - 1) * pageSize;
    }

    @Override
    public String toString() {
        return "AttendanceSearchDTO{" +
                "classId='" + classId + '\'' +
                ", studentName='" + studentName + '\'' +
                ", courseName='" + courseName + '\'' +
                ", studentId='" + studentId + '\'' +
                ", isAbsent=" + isAbsent +
                ", startDate='" + startDate + '\'' +
                ", endDate='" + endDate + '\'' +
                ", page=" + page +
                ", pageSize=" + pageSize +
                ", sortBy='" + sortBy + '\'' +
                ", sortOrder='" + sortOrder + '\'' +
                ", offset=" + getOffset() +
                '}';
    }
}
